package Demo2;

public class Demo7 {
    public static void main(String[] args) throws InterruptedException {
        Thread t1=new Thread(()->{
           while (true){
               System.out.println("hello threa");
               try {
                   Thread.sleep(1000);
               } catch (InterruptedException e) {
                   throw new RuntimeException(e);
               }
           }
        });

        t1.setDaemon(true);
        t1.start();
//        while (true){
//            System.out.println("hello mian");
//            Thread.sleep(1000);
//        }
        System.out.println("hello main");


    }
}
